//
//  RoomStateAndInfo.m
//  IHall
//
//  Created by Soyu on 12-5-16.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

/*
 *    State:Char;  //房台状态 N:可用房；R:预订；I:消费中; S:结账中; L:付款后未走房；X:房台号无效
 *    Flag:Integer; //房台标志 0：可用；1：申请带位；2：申请开房；4：清洁中；5：申请结账(现金)；6：合并后锁定的房；7:申请结账(银行卡)
 *    RoomType:String;
 *    MasterID:Array[0..15] of Char; //主单ID
 *    PriceID;Integer; //价格编号
 *    DisRate:Single;//折扣率
 *    DisClerk:String;//折扣人
 *    ReserveFlag:Integer;// 0:散客无预定;1:有预定
 *    ReserveClerkNo:String; //订房人员工代码
 *    ReserveClerk:String; //订房人姓名
 *    ReserveClerkGroup:String; //订房人分组
 *    GongGuanLeaderNo:String; //带位经理代码
 *    GongGuanLeaderName:String; //带位经理姓名
 *    GongGuanCount:Integer; //公关人数
 *    GuestName:String;//客人姓名
 *    ManCount:Integer; //客人人数
 *    RewardClerkNo:String; //公关或模特订房人的代码
 *    RewardClerk:String; //公关或模特订房人的姓名
 *    RewardZhiWu:String; //公关或模特订房人的职务
 *    TransInRoomNo:String; //转入房台号
 *    TransOutRoomNo:String; //转出房台号
 *    LowLimitMoney:Single; //最低消费
 *    XiaoFeiJinE:Single; //消费金额
 *    DiXiaoNeiZheHouXiaoFeiJinE:Single;//低消内折后消费额
 *    DiXiaoWaiJinE:Single;//不计低消的金额
 *    IfVip:Boolean;//该房间是否会员消费
 *    VipID:Integer;//消费会员的ID
 *    RoomMoneyMode:Integer;//计费模式0:最低消费模式1:房费按时段计费2:包房费+消费模式 3:纯量贩模式
 *    SettleMode:Integer;//结账方式 0:先消费后付款  1:先付款后消费(酒吧即付款)
 *    DJ1_XingMing:String;
 *    DJ2_XingMing:String;
 *    DJ3_XingMing:String;
 *    Server1_XingMing:String;
 *    Server2_XingMing:String;
 */

#import "RoomStateAndInfo.h"

@implementation RoomStateAndInfo

@synthesize  State, Flag, RoomType, MasterID, PriceID, DisRate, DisClerk, ReserveFlag, ReserveClerkNo, ReserveClerk, ReserveClerkGroup, GongGuanLeaderNo, GongGuanLeaderName, GongGuanCount, GuestName, ManCount, RewardClerkNo, RewardClerk, RewardZhiWu, TransInRoomNo, TransOutRoomNo, LowLimitMoney, XiaoFeiJinE, DiXiaoNeiZheHouXiaoFeiJinE, DiXiaoWaiJinE, IfVip, VipID, RoomMoneyMode, SettleMode, DJ1_XingMing, DJ2_XingMing, DJ3_XingMing, Server1_XingMing, Server2_XingMing, MasterLockFlag, PreSettleFlag;
- (NSString *)State
{
    return _state;
}

- (void)setState:(NSString *)aState
{
    // State:Char;  //房台状态 N:可用房；R:预订；I:消费中; S:结账中; L:付款后未走房；X:房台号无效
    if ([aState isEqualToString:@"N"])
    {
        _state = @"可用房";
        return;
    }

    if ([aState isEqualToString:@"R"])
    {
        _state = @"已预订";
        return;
    }

    if ([aState isEqualToString:@"I"] && [self.MasterLockFlag isEqualToString:@"1"])
    {
        _state = @"预留锁定";
        return;
    }

    if ([aState isEqualToString:@"I"])
    {
        _state = @"消费中";
        return;
    }

//    if ([self.RoomType isEqualToString:@"2"] && [aState isEqualToString:@"S"] && [self.PreSettleFlag isEqualToString:@"1"])
//    {
//        _state = @"预买单";
//        return;
//    }

    if ([aState isEqualToString:@"S"])
    {
        _state = @"结账中";
        return;
    }

    if ([aState isEqualToString:@"L"])
    {
        _state = @"付款后未走房";
        return;
    }

    if ([aState isEqualToString:@"X"])
    {
        _state = @"房台号无效";
        return;
    }
}

- (NSString *)Flag
{
    return _flag;
}

- (void)setFlag:(NSString *)aFlag
{
    // 房台标志 0：可用；1：申请带位；2：申请开房；4：清洁中；5：申请结账(现金)；6：合并后锁定的房；7:申请结账(银行卡)
    if ([aFlag isEqualToString:@"0"])
    {
        _flag = @"可用房";
        return;
    }

    if ([aFlag isEqualToString:@"1"])
    {
        _flag = @"申请带位";
        return;
    }

    if ([aFlag isEqualToString:@"2"])
    {
        _flag = @"申请开房";
        return;
    }

    if ([aFlag isEqualToString:@"4"])
    {
        _flag = @"清洁中";
        return;
    }

    if ([aFlag isEqualToString:@"5"])
    {
        _flag = @"申请结账(现金)";
        return;
    }

    if ([aFlag isEqualToString:@"6"])
    {
        _flag = @"合并后锁定的房";
        return;
    }

    if ([aFlag isEqualToString:@"7"])
    {
        _flag = @"申请结账(银行卡)";
        return;
    }
}

- (NSString *)ReserveFlag
{
    return _reserveFlag;
}

- (void)setReserveFlag:(NSString *)aReserveFlag
{
    // 0:散客无预定;1:有预定
    if ([aReserveFlag isEqualToString:@"0"])
    {
        _reserveFlag = @"客定";
        return;
    }

    if ([aReserveFlag isEqualToString:@"1"])
    {
        _reserveFlag = @"有预定";
        return;
    }
}

- (NSString *)RoomMoneyMode
{
    return _roomMoneyMode;
}

- (void)setRoomMoneyMode:(NSString *)aRoomMoneyMode
{
    // RoomMoneyMode:Integer;//计费模式0:最低消费模式1:房费按时段计费2:包房费+消费模式 3:纯量贩模式
    if ([aRoomMoneyMode isEqualToString:@"0"])
    {
        _reserveFlag = @"最低消费模式";
        return;
    }

    if ([aRoomMoneyMode isEqualToString:@"1"])
    {
        _reserveFlag = @"房费按时段计费";
        return;
    }

    if ([aRoomMoneyMode isEqualToString:@"2"])
    {
        _reserveFlag = @"包房费+消费模式";
        return;
    }

    if ([aRoomMoneyMode isEqualToString:@"3"])
    {
        _reserveFlag = @"量贩模式";
        return;
    }
}

// *    SettleMode:Integer;//结账方式 0:先消费后付款  1:先付款后消费(酒吧即付款)
- (NSString *)SettleMode
{
    return _settleMode;
}

- (void)setSettleMode:(NSString *)aSettleMode
{
    if ([aSettleMode isEqualToString:@"0"])
    {
        _settleMode = @"先消费后付款";
        return;
    }

    if ([aSettleMode isEqualToString:@"1"])
    {
        _settleMode = @"酒吧即付款";
        return;
    }
}

@end